<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<div class="pageContent">
	<form method="post" action="../ProductsServlet?m=doUpdate" class="pageForm required-validate"
enctype="multipart/form-data" onsubmit="return iframeCallback(this, navTabAjaxDone);">
		<input type="hidden" name="proId" value="${pro.proId}"/>
		<div class="pageFormContent" layoutH="56">
		
		<p>
				<label>大 类：</label>
				<select name="type1" id="type1" class="required">
					<c:forEach items="${type1List}" var="type1">
						<c:choose>
							<c:when test="${type1.t1Id==pro.type2.type1.t1Id}">
								<option value="${type1.t1Id}" selected="selected">${type1.t1Name}</option>
							</c:when>
							<c:otherwise>
								<option value="${type1.t1Id}">${type1.t1Name}</option>
							</c:otherwise>
						</c:choose>
					</c:forEach>
				</select>
			</p>
			<p>
				<label>小 类：</label>
				<select name="type2" id="type2" class="required">
					<c:forEach items="${type2List}" var="type2">
						<c:choose>
							<c:when test="${type2.t2Id==pro.type2.t2Id}">
								<option value="${type2.t2Id}" selected="selected">${type2.t2Name}</option>
							</c:when>
							<c:otherwise>
								<option value="${type2.t2Id}">${type2.t2Name}</option>
							</c:otherwise>
						</c:choose>
					</c:forEach>
				</select>
			</p>
			
			<p>
				<label>型 号：</label>
				<input name="proCode" class="required" type="text" size="30" value="${pro.proCode }"/>
			</p>
			<p>
				<label>狗的颜色：</label>
				<input name="proName" class="required" type="text" size="30" value="${pro.proName }"/>
			</p>
			
			<p>
				<label>狗的体重(kg)：</label>
				<input name="duoRong" type="text" size="30" value="${pro.duoRong }"/>
			</p>
			<p>
				<label>狗的友善程度：：</label>
				<input name="pw" type="text" size="30" value="${pro.pw }"/>
			</p>
			<p>
				<label>狗的聪明等级</label>
				<input name="niuJV" type="text" size="30" value="${pro.niuJv }"/>
			</p>
			<p>
				<label>掉毛程度：</label>
				<input name="pai" type="text" size="30" value="${pro.pai }"/>
			</p>
			<p>
				<label>是否爱叫：</label>
				<input name="speed" type="text" size="30" value="${pro.speed }"/>
			</p>
			<p>
				<label>图 片：(不修改不选图)</label>
				<input name="file" type="file"/>
			</p>
			<div class="divider"></div>
			<p>
				<label>创建日期：</label>
				<input value="${pro.createTime }" readonly="readonly" type="text" size="30" />
			</p>
			<p>
				<label>创建人员：</label>
				<input readonly="readonly" type="text" size="30" value="${pro.creator}"/>
			</p>
			<p>
				<label>最新修改时间：</label>
				<input value="<%=new java.util.Date().toLocaleString() %>" readonly="readonly" type="text" size="30"/>
			</p>
			<p>
				<label>最新修改人员：</label>
				<input readonly="readonly" type="text" size="30" value="${pro.updator}"/>
			</p>
		</div>
		<div class="formBar">
			<ul>
				<!--<li><a class="buttonActive" href="javascript:;"><span>保存</span></a></li>-->
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li>
				<li>
					<div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div>
				</li>
			</ul>
		</div>
	</form>
</div>
<script>
	$(function(){
		var type1 = $("#type1");
		var type2 = $("#type2");
		type1.change(function(){
			type2.loadUrl("../Type2Servlet", {"m":"doFindByType1", "t1Id":type1.val()});
		});
	});
</script>
   